<%@ page pageEncoding="UTF-8"%>
<%@ page import="com.hwhp.entity.*"%>
<%@ page import="java.util.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>角色管理</title>
		<LINK href="<%=basePath%>css/milkwhite.css" type=TEXT/CSS rel=StyleSheet></LINK>
		<LINK href="<%=basePath%>css/htmilkwhite.css" type=TEXT/CSS rel=StyleSheet></LINK>
		<LINK href="<%=basePath%>css/dhtmlxgrid.css" type=TEXT/CSS rel=StyleSheet></LINK>
		<SCRIPT src="<%=basePath%>js/list/dhtmlxcommon.js" type=text/javascript></SCRIPT>
		<SCRIPT src="<%=basePath%>js/list/dhtmlxgrid.js" type=text/javascript></SCRIPT>
		<SCRIPT src="<%=basePath%>js/list/dhtmlxgridcell.js" type=text/javascript></SCRIPT>
		<SCRIPT src="<%=basePath%>js/list/dhtmlxgrid_start.js" type=text/javascript></SCRIPT>
	</head>
	<%
List<Role> list=(List<Role>)request.getAttribute("roleList");
String search=(String )request.getAttribute("search");
    if("null".equals(search)||search==null){
      search="";
    }
 %>
	<body style="MARGIN: 0px;" onunload="init()" id="body">
		<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%"
			align=center border=0>
			<TBODY>
				<TR>
					<TD style="WIDTH:100%; HEIGHT: 12px"
						background=<%=basePath%>images/commom/index_r4_c9.jpg colSpan=2></TD>
				</TR>
				<TR>
					<TD align=top width=100%>
						<TABLE height="100%" cellSpacing=0 cellPadding=0 width="90%"
							border=0 align="center">
							<TBODY>
								<TR>
									<TD height=26>
										<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0
											align="center">
											<TBODY>
												<TR>
													<TD class=linelabel3 vAlign=bottom background=<%=basePath%>images/commom/00_r5_c30.jpg>
														系统管理>>角色管理
													</TD>
												</TR>
											</TBODY>
										</TABLE>
									</TD>
								</TR>
								<TR>
									<TD class=border2 width="90%" height="100%">
										<FORM id="formlist" name="formlist" action="/chis/manager/role!roleList.action" method="post">
											<TABLE id=tab1 height="100%" cellSpacing=0 cellPadding=0
												width="100%" border=0>
												<TBODY>
													<TR>
													   <TD class=middlemiddle>
													        <TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
				<TBODY>
					<TR>
						<TD height=20></TD>
						<TD height=20></TD>
						<TD height=20></TD>
					</TR>
					<TR>
						<TD class=middlelinel></TD>
						<TD height=20>
							<!-- 搜索 -->
							<TABLE cellSpacing=0 cellPadding=0 border=0 width="100%">
								<TBODY>
									<TR>
										<TD style="WIDTH: 70px" align=right>
											角色名称:
										</TD>
										<TD style="WIDTH: 80px" align=right>
											<INPUT id=search name=search value="<%=search %>">
										</TD>
										<TD style="WIDTH: 8px"></TD>
										<TD class=searchheight>
											<TABLE class=button onmouseover="this.className='buthot'"
												onmouseout="this.className='button'" cellSpacing=0
												cellPadding=0 border=0>
												<TBODY>
													<TR onclick=formlist.submit();>
														<TD class=buttoncelerity></TD>
														<TD class=buttonmiddle>
															检索
														</TD>
														<TD class=buttonright></TD>
													</TR>
												</TBODY>
											</TABLE>
										</TD>
										<TD width=5></TD>
										<TD>
											<B>1/0</B> 共
											<B>0</B> 条
										</TD>
										<TD vAlign=top align="right">
											<table border='0' cellpadding='2' cellspacing='0'>
												<tr height="20">
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttoncelerity1.gif);width:22px;'></td>
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttonmiddle1.gif);cursor: hand;'>
														<a href="/chis/manager/role!roleEdit.action?act=add">新增</a>
													</td>
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttonright1.gif);width:6px;'></td>
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttonclose1.gif);width:22px;'></td>
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttonmiddle1.gif);cursor: hand;'
														onclick="updateProcess()">
														修改
													</td>
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttonright1.gif);width:6px;'></td>
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttondelete1.gif);width:22px;'></td>
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttonmiddle1.gif);cursor: hand;'
														onclick="deleteProcess()">
														删除
													</td>
													<td
														style='background-image:url(<%=basePath%>images/button/w_buttonright1.gif);width:6px;'></td>
												</tr>
											</table>
										</TD>
									</TR>
								</TBODY>
							</TABLE>
						</TD>
						<TD class=middleliner></TD>
					</TR>
					<TR>
						<TD class=middlelinel></TD>
						<TD
							style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"
							vAlign=top>
							<TABLE class=dhtmlxGrid id=gridbox height="90%" width="100%">
								<TBODY>
									<TR>
									    <TD noWrap type="ro" style="width:30">
									       <INPUT class=input3 id=alldepartid name=departid value="" type="checkbox">
										</TD>
									    <TD noWrap type="ro" style="width:50">
									         序号
										</TD>
										<TD noWrap type="ro">
											角色名称
										</TD>
										<TD noWrap type="ro">
											角色编码
										</TD>
										<TD noWrap type="ro">
											状态
										</TD>
										<TD noWrap type="ro" style="width:450">
											功能
										</TD>
										<TD noWrap type="ro">
											操作
										</TD>
									</TR>
									<%
									 if(list!=null&&list.size()>0){
									  int i=1;
									  for(Role roleObj:list){
									 %>
									<TR>
									    <TD noWrap style="width:30">
									       <INPUT class=input3 id=alldepartid name=departid value="" type="checkbox">
										</TD>
									    <TD noWrap align="center">
									       <%=i%>
										</TD>
										<TD noWrap>
										    <%="".equals(roleObj.getRolename())?"无":roleObj.getRolename() %>
										</TD>
										<TD noWrap>
										    <%="".equals(roleObj.getRolecode())?"无":roleObj.getRolecode() %>
										</TD>
										<TD noWrap align="center">
										    <%="1".equals(roleObj.getIsUsed())?"启用":"停用" %>
										</TD>
										<TD noWrap>
										    <%="".equals(roleObj.getFunctionset())?"无":roleObj.getFunctionset() %>
										</TD>
										<TD noWrap align="center">
											<img src="<%=basePath%>images/button/edit.gif" style="cursor: hand" onclick="editProcess('<%=roleObj.getId() %>')">&nbsp;&nbsp;
											<img src="<%=basePath%>images/button/del.gif" title="删除" style="cursor: hand" onclick="deleteProcess('<%=roleObj.getId() %>')">
										</TD>
									</TR>
									<%
									 i++;
									 }
									 }else{
									 %>
									 
									 <%
									 }
									  %>
								</TBODY>
							</TABLE>
						</TD>
					<TD class=middleliner></TD>
					</TR>
					<TR>
						<TD class=middlebottoml></TD>
						<TD class=middlebottomm></TD>
						<TD class=middlebottomr></TD>
					</TR>
				</TBODY>
			</TABLE>
														</TD>
													</TR>
												</TBODY>
											</TABLE>
							</FORM>
							</TD>
							</TR>
							</TBODY>
						</TABLE>
					</TD>
				</TR>
			</TBODY>
		</TABLE>
	</body>
	<script type="text/javascript">
	  function editProcess(roleid){
		  formlist.action="/chis/manager/role!roleEdit.action?roleid="+roleid+"&act=edit";
		  formlist.submit();
		}
		
	  function deleteProcess(roleid){
		  formlist.action="/chis/manager/role!deleteRole.action?roleid="+roleid+"&Random="+Math.random();
		  formlist.submit();
		}
	</script>
</html>
